home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / _views_BrowseYearTabWatcherSetupUtil.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  3.1 KB  |  79 lines

  1. package
  2. {
  3.    import flash.display.Sprite;
  4.    import mx.binding.FunctionReturnWatcher;
  5.    import mx.binding.IWatcherSetupUtil;
  6.    import mx.binding.PropertyWatcher;
  7.    import mx.binding.RepeaterItemWatcher;
  8.    import mx.binding.Watcher;
  9.    import mx.core.IFlexModuleFactory;
  10.    import views.BrowseYearTab;
  11.    
  12.    public class _views_BrowseYearTabWatcherSetupUtil extends Sprite implements IWatcherSetupUtil
  13.    {
  14.       public function _views_BrowseYearTabWatcherSetupUtil()
  15.       {
  16.          super();
  17.       }
  18.       
  19.       public static function init(param1:IFlexModuleFactory) : void
  20.       {
  21.          BrowseYearTab.watcherSetupUtil = new _views_BrowseYearTabWatcherSetupUtil();
  22.       }
  23.       
  24.       public function setup(param1:Object, param2:Function, param3:Array, param4:Array) : void
  25.       {
  26.          var tempWatcher:Watcher = null;
  27.          var target:Object = param1;
  28.          var propertyGetter:Function = param2;
  29.          var bindings:Array = param3;
  30.          var watchers:Array = param4;
  31.          watchers[1] = new PropertyWatcher("presentationModel",{"propertyChange":true});
  32.          watchers[2] = new PropertyWatcher("years",{"propertyChange":true});
  33.          watchers[3] = new PropertyWatcher("yearsRpt",{"propertyChange":true});
  34.          watchers[4] = new PropertyWatcher("dataProvider",{"collectionChange":true});
  35.          watchers[5] = new RepeaterItemWatcher(watchers[4]);
  36.          watchers[7] = new PropertyWatcher("issue",null);
  37.          watchers[8] = new FunctionReturnWatcher("getItemAt",target,function():Array
  38.          {
  39.             return [0];
  40.          },null);
  41.          watchers[9] = new PropertyWatcher("file",null);
  42.          watchers[6] = new PropertyWatcher("value",null);
  43.          watchers[1].addListener(bindings[0]);
  44.          watchers[1].propertyGetter = propertyGetter;
  45.          watchers[1].updateParent(target);
  46.          watchers[2].addListener(bindings[0]);
  47.          watchers[1].addChild(watchers[2]);
  48.          tempWatcher = watchers[3];
  49.          tempWatcher.addListener(bindings[2]);
  50.          tempWatcher.addListener(bindings[1]);
  51.          watchers[3].propertyGetter = propertyGetter;
  52.          watchers[3].updateParent(target);
  53.          tempWatcher = watchers[4];
  54.          tempWatcher.addListener(bindings[2]);
  55.          tempWatcher.addListener(bindings[1]);
  56.          watchers[3].addChild(watchers[4]);
  57.          watchers[4].addChild(watchers[5]);
  58.          watchers[7].addListener(bindings[2]);
  59.          watchers[5].addChild(watchers[7]);
  60.          watchers[8].addListener(bindings[2]);
  61.          watchers[8].parentWatcher = watchers[7];
  62.          watchers[7].addChild(watchers[8]);
  63.          watchers[9].addListener(bindings[2]);
  64.          watchers[8].addChild(watchers[9]);
  65.          tempWatcher = watchers[6];
  66.          tempWatcher.addListener(bindings[2]);
  67.          tempWatcher.addListener(bindings[1]);
  68.          watchers[5].addChild(watchers[6]);
  69.          bindings[0].uiComponentWatcher = 1;
  70.          bindings[0].execute();
  71.          bindings[1].uiComponentWatcher = 3;
  72.          bindings[1].execute();
  73.          bindings[2].uiComponentWatcher = 3;
  74.          bindings[2].execute();
  75.       }
  76.    }
  77. }
  78.  
  79.